package com.qingke.besuper.command;

import com.qingke.besuper.pojo.User;

public abstract class CommandFactory {
	public static enum CommandCode{
		//System
		LOGIN,
		REGISTER,
		HELP,
		EXIT,
		//User
		LIST,
		LIST_P,
		LIST_Q,
		LIST_A,
		ASK,
		ANSWER,
		SCORE,
		OPEN,
		CLOSE,
		BEST
	}
	public static CommandFactory getFactory(User user){
		if(user==null){
			return new SystemCommandFactory();
		}
		return new UserCommandFactory(user);
	}
	public abstract Command buildCommand(CommandCode cmdCode);
}
